package systemcontract

import (
	"math/big"

	"github.com/ethereum/go-ethereum/common"
	"github.com/ethereum/go-ethereum/core"
	"github.com/ethereum/go-ethereum/core/state"
	"github.com/ethereum/go-ethereum/core/types"
	"github.com/ethereum/go-ethereum/log"
	"github.com/ethereum/go-ethereum/params"
)

const (
	validatorsV2Code = "0x608060405260043610620002665760003560e01c80639001eed8116200014b578063c3ab251011620000bb578063f04a5dcd1162000079578063f04a5dcd146200090f578063f14693821462000940578063f3b1cc671462000974578063f40f0f52146200098c578063f851a44014620009c35762000266565b8063c3ab25101462000887578063c885bc5814620008be578063c967f90f14620008d6578063d6c0edad1462000905578063ec0cb33614620002db5762000266565b8063b34f88e81162000109578063b34f88e814620007c0578063bb8b65af14620007d8578063bbc7168014620007f0578063bcecf81b1462000841578063bed99850146200086f5762000266565b80639001eed814620007485780639cc02c3014620007605780639de702581462000778578063a7565c511462000790578063afeea11514620007a85762000266565b8063455ab41e11620001e757806371a1bb7511620001a557806371a1bb75146200068057806371df76781462000698578063741579b114620006b05780638f28397014620006c85780638fffcbd014620006ff5762000266565b8063455ab41e14620003c55780635274ac3f14620003dd57806360544bf1146200052657806365f69f9714620005905780636846992a14620005c75762000266565b80631c0ffaa211620002355780631c0ffaa214620002f35780632e4f67e414620002db5780633a82fd5e146200033257806341fbb050146200037957806344f9990014620003ad5762000266565b806303fab4f6146200026b578063136ec0b31462000295578063158ef93e14620002af57806315de360e14620002db575b600080fd5b3480156200027857600080fd5b5062000283620009db565b60408051918252519081900360200190f35b348015620002a257600080fd5b50620002ad620009e8565b005b348015620002bc57600080fd5b50620002c762000c33565b604080519115158252519081900360200190f35b348015620002e857600080fd5b506200028362000c3c565b3480156200030057600080fd5b50620002ad600480360360408110156200031957600080fd5b506001600160a01b038135169060200135151562000c43565b3480156200033f57600080fd5b5062000363600480360360208110156200035857600080fd5b503560ff1662000d63565b6040805160ff9092168252519081900360200190f35b3480156200038657600080fd5b506200039162000d78565b604080516001600160a01b039092168252519081900360200190f35b348015620003ba57600080fd5b506200039162000d87565b348015620003d257600080fd5b506200028362000d8d565b348015620003ea57600080fd5b50620002ad600480360360608110156200040357600080fd5b8101906020810181356401000000008111156200041f57600080fd5b8201836020820111156200043257600080fd5b803590602001918460208302840111640100000000831117156200045557600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050640100000000811115620004a657600080fd5b820183602082011115620004b957600080fd5b80359060200191846020830284011164010000000083111715620004dc57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550505090356001600160a01b0316915062000d939050565b3480156200053357600080fd5b506200053e6200118a565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156200057c57818101518382015260200162000562565b505050509050019250505060405180910390f35b3480156200059d57600080fd5b506200039160048036036020811015620005b657600080fd5b50356001600160a01b0316620011ee565b348015620005d457600080fd5b50620002ad60048036036040811015620005ed57600080fd5b8101906020810181356401000000008111156200060957600080fd5b8201836020820111156200061c57600080fd5b803590602001918460208302840111640100000000831117156200063f57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550509135925062001209915050565b3480156200068d57600080fd5b5062000391620016ba565b348015620006a557600080fd5b50620002ad620016c0565b348015620006bd57600080fd5b50620002836200184f565b348015620006d557600080fd5b50620002ad60048036036020811015620006ee57600080fd5b50356001600160a01b03166200185b565b3480156200070c57600080fd5b50620002ad600480360360808110156200072557600080fd5b5060ff813581169160208101358216916040820135811691606001351662001953565b3480156200075557600080fd5b506200028362001b6b565b3480156200076d57600080fd5b506200028362001b79565b3480156200078557600080fd5b506200053e62001b7f565b3480156200079d57600080fd5b50620002ad62001be1565b348015620007b557600080fd5b506200053e62001c86565b348015620007cd57600080fd5b506200028362001f89565b348015620007e557600080fd5b50620002ad62001f8f565b348015620007fd57600080fd5b5062000391600480360360808110156200081657600080fd5b5080356001600160a01b03908116916020810135909116906040810135906060013560ff16620021d5565b3480156200084e57600080fd5b5062000391600480360360208110156200086757600080fd5b5035620023bf565b3480156200087c57600080fd5b5062000283620023e7565b3480156200089457600080fd5b50620002ad60048036036020811015620008ad57600080fd5b50356001600160a01b0316620023ed565b348015620008cb57600080fd5b50620002ad62002493565b348015620008e357600080fd5b50620008ee620024fb565b6040805161ffff9092168252519081900360200190f35b620002ad62002500565b3480156200091c57600080fd5b5062000363600480360360208110156200093557600080fd5b503560ff1662002a95565b3480156200094d57600080fd5b50620002ad600480360360408110156200096657600080fd5b508035906020013562002aaa565b3480156200098157600080fd5b506200028362002b98565b3480156200099957600080fd5b506200028360048036036020811015620009b257600080fd5b50356001600160a01b031662002b9f565b348015620009d057600080fd5b506200039162002bb1565b68056bc75e2d6310000081565b6000339050806001600160a01b031660076000836001600160a01b0316633a5381b56040518163ffffffff1660e01b815260040160206040518083038186803b15801562000a3557600080fd5b505afa15801562000a4a573d6000803e3d6000fd5b505050506040513d602081101562000a6157600080fd5b50516001600160a01b039081168252602082019290925260400160002054161462000ace576040805162461bcd60e51b8152602060048201526018602482015277159bdd19481c1bdbdb081b9bdd081c9959da5cdd195c995960421b604482015290519081900360640190fd5b336001816001600160a01b031663c19d93fb6040518163ffffffff1660e01b815260040160206040518083038186803b15801562000b0b57600080fd5b505afa15801562000b20573d6000803e3d6000fd5b505050506040513d602081101562000b3757600080fd5b5051600381111562000b4557fe5b1462000b8a576040805162461bcd60e51b815260206004820152600f60248201526e496e636f727265637420737461746560881b604482015290519081900360640190fd5b6000600a6000836001600160a01b031663683c529c6040518163ffffffff1660e01b815260040160206040518083038186803b15801562000bca57600080fd5b505afa15801562000bdf573d6000803e3d6000fd5b505050506040513d602081101562000bf657600080fd5b5051600181111562000c0457fe5b600181111562000c1057fe5b81526020810191909152604001600020905062000c2e818362002bc5565b505050565b60005460ff1681565b6201518081565b60005461010090046001600160a01b0316331462000c95576040805162461bcd60e51b815260206004820152600a60248201526927b7363c9030b236b4b760b11b604482015290519081900360640190fd5b6001600160a01b038281166000908152600760205260409020541662000ced5760405162461bcd60e51b8152600401808060200182810382526021815260200180620067006021913960400191505060405180910390fd5b6001600160a01b03808316600090815260076020526040808220548151638ec7a23d60e01b815285151560048201529151931692638ec7a23d9260248084019391929182900301818387803b15801562000d4657600080fd5b505af115801562000d5b573d6000803e3d6000fd5b505050505050565b60016020526000908152604090205460ff1681565b600c546001600160a01b031681565b61f00681565b600f5481565b60005460ff161562000de2576040805162461bcd60e51b8152602060048201526013602482015272105b1c9958591e481a5b9a5d1a585b1a5e9959606a1b604482015290519081900360640190fd5b6000835111801562000df5575081518351145b62000e38576040805162461bcd60e51b815260206004820152600e60248201526d496e76616c696420706172616d7360901b604482015290519081900360640190fd5b6001600160a01b03811662000e8c576040805162461bcd60e51b8152602060048201526015602482015274496e76616c69642061646d696e206164647265737360581b604482015290519081900360640190fd5b60008054600160ff199091168117610100600160a81b0319166101006001600160a01b038516021782558180600181111562000ec457fe5b815260200190815260200160002060006101000a81548160ff021916908360ff16021790555060156001600060018081111562000efd57fe5b600181111562000f0957fe5b81526020808201929092526040016000908120805460ff9490941660ff1994851617905560029091527fac33ff75c19e70fe83507db0d683fd3465c996598dc972688b7ace676c89077b805483169055600181527fe90b7bceb6e7df5418fb78d8ee546e97c83a08bbccc01a0644d599ccd2a7c2e080549092169091555b83518160ff16101562001184576000848260ff168151811062000fa657fe5b6020908102919091018101516001600160a01b0380821660009081526007909352604090922054909250161562001020576040805162461bcd60e51b815260206004820152601960248201527856616c696461746f727320616c72656164792065786973747360381b604482015290519081900360640190fd5b600081858460ff16815181106200103357fe5b60200260200101516127106001806040516200104f9062003a84565b80866001600160a01b03168152602001856001600160a01b031681526020018481526020018360018111156200108157fe5b81526020018260038111156200109357fe5b815260200195505050505050604051809103906000f080158015620010bc573d6000803e3d6000fd5b5060068054600181019091557ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f0180546001600160a01b038086166001600160a01b031992831681179093556000928352600760205260408084208054928616929093168217909255815163204a7f0760e21b8152915193945092638129fc1c9260048084019391929182900301818387803b1580156200115c57600080fd5b505af115801562001171573d6000803e3d6000fd5b50506001909401935062000f8792505050565b50505050565b60606004805480602002602001604051908101604052809291908181526020018280548015620011e457602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311620011c5575b5050505050905090565b6007602052600090815260409020546001600160a01b031681565b3341146200124b576040805162461bcd60e51b815260206004820152600a6024820152694d696e6572206f6e6c7960b01b604482015290519081900360640190fd5b436000908152600b60209081526040808320600180855292529091205460ff1615620012b1576040805162461bcd60e51b815260206004820152601060248201526f105b1c9958591e481bdc195c985d195960821b604482015290519081900360640190fd5b81804381620012bc57fe5b061562001303576040805162461bcd60e51b815260206004820152601060248201526f426c6f636b2065706f6368206f6e6c7960801b604482015290519081900360640190fd5b60005460ff166200134a576040805162461bcd60e51b815260206004820152600c60248201526b139bdd081a5b9a5d081e595d60a21b604482015290519081900360640190fd5b436000908152600b60209081526040808320600180855292528220805460ff191690911790555b60035460ff82161015620013d65760006005600060038460ff16815481106200139657fe5b6000918252602080832091909101546001600160a01b031683528201929092526040019020805460ff191660ff9290921691909117905560010162001371565b508351620013ec90600390602087019062003a92565b5060005b60035460ff82161015620014555760016005600060038460ff16815481106200141557fe5b6000918252602080832091909101546001600160a01b031683528201929092526040019020805460ff191660ff92909216919091179055600101620013f0565b50620014646004600062003afc565b6200146e62003b1f565b50604080518082019091526000808252600160208301525b60028160ff16101562000d5b57600060026000848460ff1660028110620014a957fe5b60200201516001811115620014ba57fe5b6001811115620014c657fe5b815260200190815260200160002060009054906101000a900460ff1690506000600a6000858560ff1660028110620014fa57fe5b602002015160018111156200150b57fe5b60018111156200151757fe5b8152602081019190915260400160002080549091506001600160a01b03165b60008360ff161180156200155257506001600160a01b03811615155b15620016ae5760056000826001600160a01b0316633a5381b56040518163ffffffff1660e01b815260040160206040518083038186803b1580156200159657600080fd5b505afa158015620015ab573d6000803e3d6000fd5b505050506040513d6020811015620015c257600080fd5b50516001600160a01b0316815260208101919091526040016000205460ff166200168b576004816001600160a01b0316633a5381b56040518163ffffffff1660e01b815260040160206040518083038186803b1580156200162257600080fd5b505afa15801562001637573d6000803e3d6000fd5b505050506040513d60208110156200164e57600080fd5b505181546001810183556000928352602090922090910180546001600160a01b0319166001600160a01b0390921691909117905560001992909201915b6001600160a01b0390811660009081526003830160205260409020541662001536565b50505060010162001486565b61f00581565b6000339050806001600160a01b031660076000836001600160a01b0316633a5381b56040518163ffffffff1660e01b815260040160206040518083038186803b1580156200170d57600080fd5b505afa15801562001722573d6000803e3d6000fd5b505050506040513d60208110156200173957600080fd5b50516001600160a01b0390811682526020820192909252604001600020541614620017a6576040805162461bcd60e51b8152602060048201526018602482015277159bdd19481c1bdbdb081b9bdd081c9959da5cdd195c995960421b604482015290519081900360640190fd5b60003390506000600a6000836001600160a01b031663683c529c6040518163ffffffff1660e01b815260040160206040518083038186803b158015620017eb57600080fd5b505afa15801562001800573d6000803e3d6000fd5b505050506040513d60208110156200181757600080fd5b505160018111156200182557fe5b60018111156200183157fe5b81526020810191909152604001600020905062000c2e818362003183565b670de0b6b3a764000081565b806001600160a01b038116620018aa576040805162461bcd60e51b815260206004820152600f60248201526e496e76616c6964206164647265737360881b604482015290519081900360640190fd5b60005461010090046001600160a01b03163314620018fc576040805162461bcd60e51b815260206004820152600a60248201526927b7363c9030b236b4b760b11b604482015290519081900360640190fd5b60008054610100600160a81b0319166101006001600160a01b03858116820292909217808455604051919004909116917f927cc064d7b7fa546fa7706bc01845d27d06f15af3ae90a672cc44735928e96191a25050565b60005461010090046001600160a01b03163314620019a5576040805162461bcd60e51b815260206004820152600a60248201526927b7363c9030b236b4b760b11b604482015290519081900360640190fd5b60ff84830116601514620019f1576040805162461bcd60e51b815260206004820152600e60248201526d496e76616c696420636f756e747360901b604482015290519081900360640190fd5b8360ff168360ff161115801562001a0e57508160ff168160ff1611155b62001a58576040805162461bcd60e51b8152602060048201526015602482015274496e76616c6964206261636b757020636f756e747360581b604482015290519081900360640190fd5b7fa6eef7e35abe7026729641147f7915573c7e97b47efa546f5f6e3230263bcb49805460ff86811660ff1992831681179093557fcc69885fda6bcc1a4ace058b4a62bf5e179ea78fd58a1ccd71c22cc9b688792f80548683169084168117909155600260209081527fac33ff75c19e70fe83507db0d683fd3465c996598dc972688b7ace676c89077b8054851689851690811790915560016000527fe90b7bceb6e7df5418fb78d8ee546e97c83a08bbccc01a0644d599ccd2a7c2e080549095169387169384179094556040805195865290850193909352838301526060830152517fef8fc40942f0314a9f5ebd7832ff1b78e6c4b5b7062355066b0c0e3e0edc6f29916080908290030190a150505050565b69010f0cf064dd5920000081565b60065490565b60606003805480602002602001604051908101604052809291908181526020018280548015620011e4576020028201919060005260206000209081546001600160a01b03168152600190910190602001808311620011c5575050505050905090565b600c546001600160a01b0316331462001c33576040805162461bcd60e51b815260206004820152600f60248201526e27b7363c903337bab73230ba34b7b760891b604482015290519081900360640190fd5b600d8054600090915562001c48338262003378565b604080513381526020810183905281517f2370ce4725209567266acc459e3a571cc7cf844d502af9501f652f9b23ada7d8929181900390910190a150565b6060600062001c9462003b1f565b50604080518082019091526000808252600160208301525b60028160ff16101562001da7576000828260ff166002811062001ccb57fe5b602002015190506000600a600083600181111562001ce557fe5b600181111562001cf157fe5b815260200190815260200160002090506001600083600181111562001d1257fe5b600181111562001d1e57fe5b8152602081019190915260400160002054600182015460ff918216600160a01b909104909116101562001d65576001810154600160a01b900460ff16949094019362001d9c565b6001600083600181111562001d7657fe5b600181111562001d8257fe5b815260208101919091526040016000205460ff1694909401935b505060010162001cac565b5060608260ff1667ffffffffffffffff8111801562001dc557600080fd5b5060405190808252806020026020018201604052801562001df0578160200160208202803683370190505b5090506000805b60028160ff16101562001f7f576000848260ff166002811062001e1657fe5b602002015190506000600a600083600181111562001e3057fe5b600181111562001e3c57fe5b8152602001908152602001600020905060006001600084600181111562001e5f57fe5b600181111562001e6b57fe5b8152602081019190915260400160002054825460ff90911691506001600160a01b03165b60008260ff1611801562001eab57506001600160a01b03811615155b1562001f6e57806001600160a01b0316633a5381b56040518163ffffffff1660e01b815260040160206040518083038186803b15801562001eeb57600080fd5b505afa15801562001f00573d6000803e3d6000fd5b505050506040513d602081101562001f1757600080fd5b50518751889060ff891690811062001f2b57fe5b6001600160a01b03928316602091820292909201810191909152918116600090815260038501909252604090912054600190960195600019909201911662001e8f565b50506001909201915062001df79050565b5090935050505090565b600d5481565b6000339050806001600160a01b031660076000836001600160a01b0316633a5381b56040518163ffffffff1660e01b815260040160206040518083038186803b15801562001fdc57600080fd5b505afa15801562001ff1573d6000803e3d6000fd5b505050506040513d60208110156200200857600080fd5b50516001600160a01b039081168252602082019290925260400160002054161462002075576040805162461bcd60e51b8152602060048201526018602482015277159bdd19481c1bdbdb081b9bdd081c9959da5cdd195c995960421b604482015290519081900360640190fd5b336001816001600160a01b031663c19d93fb6040518163ffffffff1660e01b815260040160206040518083038186803b158015620020b257600080fd5b505afa158015620020c7573d6000803e3d6000fd5b505050506040513d6020811015620020de57600080fd5b50516003811115620020ec57fe5b1462002131576040805162461bcd60e51b815260206004820152600f60248201526e496e636f727265637420737461746560881b604482015290519081900360640190fd5b6000600a6000836001600160a01b031663683c529c6040518163ffffffff1660e01b815260040160206040518083038186803b1580156200217157600080fd5b505afa15801562002186573d6000803e3d6000fd5b505050506040513d60208110156200219d57600080fd5b50516001811115620021ab57fe5b6001811115620021b757fe5b81526020810191909152604001600020905062000c2e818362003462565b6000805461010090046001600160a01b0316331462002228576040805162461bcd60e51b815260206004820152600a60248201526927b7363c9030b236b4b760b11b604482015290519081900360640190fd5b6001600160a01b03858116600090815260076020526040902054161562002292576040805162461bcd60e51b815260206004820152601960248201527856616c696461746f727320616c72656164792065786973747360381b604482015290519081900360640190fd5b6000858585856000604051620022a89062003a84565b80866001600160a01b03168152602001856001600160a01b03168152602001848152602001836001811115620022da57fe5b8152602001826003811115620022ec57fe5b815260200195505050505050604051809103906000f08015801562002315573d6000803e3d6000fd5b5060068054600181019091557ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f0180546001600160a01b03808a166001600160a01b03199283168117909355600083815260076020908152604091829020805493871693909416831790935580519182525193945091927f1ab57f2e2a6e4069160cc6501d8012d93ed435770b1ed646f82482a2f7234ff49281900390910190a295945050505050565b60068181548110620023cd57fe5b6000918252602090912001546001600160a01b0316905081565b600e5481565b60005461010090046001600160a01b031633146200243f576040805162461bcd60e51b815260206004820152600a60248201526927b7363c9030b236b4b760b11b604482015290519081900360640190fd5b600c80546001600160a01b0383166001600160a01b0319909116811790915560408051918252517ff38729ed26c992c585dcf939cf3ca97e8265d59fbb49df4b96547f3526c439fb9181900360200190a150565b3360009081526009602052604090205480620024b05750620024f9565b336000818152600960205260408082208290558051600162c261b160e01b03198152905163ff3d9e4f9285926004808201939182900301818588803b15801562000d4657600080fd5b565b601581565b33411462002542576040805162461bcd60e51b815260206004820152600a6024820152694d696e6572206f6e6c7960b01b604482015290519081900360640190fd5b436000908152600b6020908152604080832083805290915281205460ff1615620025a6576040805162461bcd60e51b815260206004820152601060248201526f105b1c9958591e481bdc195c985d195960821b604482015290519081900360640190fd5b60005460ff16620025ed576040805162461bcd60e51b815260206004820152600c60248201526b139bdd081a5b9a5d081e595d60a21b604482015290519081900360640190fd5b436000908152600b602090815260408083208380529091528120805460ff19166001179055600e546200263290612710906200262b90349062003836565b906200389d565b90506200264261faaa8262003378565b6000620026626127106200262b600f54346200383690919063ffffffff16565b600d54909150620026749082620038e1565b600d819055506000620026a4826200269d856200269d60085434620038e190919063ffffffff16565b906200393c565b90506000620026bb60646200262b84600a62003836565b90506000620026d260646200262b85602862003836565b90506000620026e960646200262b86603262003836565b60045490915015620028f3576000805b60045460ff82161015620027c057620027b56007600060048460ff16815481106200272057fe5b60009182526020808320909101546001600160a01b03908116845283820194909452604092830190912054825163f1cea4c760e01b8152925193169263f1cea4c7926004808201939291829003018186803b1580156200277f57600080fd5b505afa15801562002794573d6000803e3d6000fd5b505050506040513d6020811015620027ab57600080fd5b50518390620038e1565b9150600101620026f9565b508015620028f15760005b60045460ff82161015620028ef5760006007600060048460ff1681548110620027f057fe5b60009182526020808320909101546001600160a01b039081168452838201949094526040928301822054835163f1cea4c760e01b81529351941694509092620028959287926200262b92879263f1cea4c7926004808301939192829003018186803b1580156200285f57600080fd5b505afa15801562002874573d6000803e3d6000fd5b505050506040513d60208110156200288b57600080fd5b50518a9062003836565b6001600160a01b038316600090815260096020526040902054909150620028bd9082620038e1565b6001600160a01b038316600090815260096020526040902055620028e288826200393c565b97505050600101620027cb565b505b505b6003541562002a8a576000805b60035460ff821610156200293257620029276007600060038460ff16815481106200272057fe5b915060010162002900565b5060005b60035460ff8216101562002a875760006007600060038460ff16815481106200295b57fe5b60009182526020808320909101546001600160a01b03908116845290830193909352604090910181205460035492169250906200299a9086906200389d565b9050831562002a3057600062002a1e856200262b89866001600160a01b031663f1cea4c76040518163ffffffff1660e01b815260040160206040518083038186803b158015620029e957600080fd5b505afa158015620029fe573d6000803e3d6000fd5b505050506040513d602081101562002a1557600080fd5b50519062003836565b905062002a2c8282620038e1565b9150505b6001600160a01b03821660009081526009602052604090205462002a559082620038e1565b6001600160a01b03831660009081526009602052604090205562002a7a88826200393c565b9750505060010162002936565b50505b505050600855505050565b60026020526000908152604090205460ff1681565b60005461010090046001600160a01b0316331462002afc576040805162461bcd60e51b815260206004820152600a60248201526927b7363c9030b236b4b760b11b604482015290519081900360640190fd5b61271062002b0b8383620038e1565b111562002b4f576040805162461bcd60e51b815260206004820152600d60248201526c496e76616c696420726174657360981b604482015290519081900360640190fd5b600e829055600f819055604080518381526020810183905281517f534c90d33ce4af09747aca8d4f972eb070811868adeba0df97346a9c6d5e948b929181900390910190a15050565b6206270081565b60096020526000908152604090205481565b60005461010090046001600160a01b031681565b6001820154600160a01b900460ff1662002c2a5781546001600160a01b0382166001600160a01b0319918216811784556001808501805460ff600160a01b91909516909317838104851690920190931690910260ff60a01b199091161790556200317f565b81546001600160a01b038281169116141562002c46576200317f565b6001600160a01b038082166000908152600284016020526040902054168062002def576001808401805460ff600160a01b80830482169094011690920260ff60a01b1990921691909117908190556040805163f1cea4c760e01b815290516001600160a01b039092169163f1cea4c791600480820192602092909190829003018186803b15801562002cd757600080fd5b505afa15801562002cec573d6000803e3d6000fd5b505050506040513d602081101562002d0357600080fd5b50516040805163f1cea4c760e01b815290516001600160a01b0385169163f1cea4c7916004808301926020929190829003018186803b15801562002d4657600080fd5b505afa15801562002d5b573d6000803e3d6000fd5b505050506040513d602081101562002d7257600080fd5b50511162002dda57506001820180546001600160a01b038381166000818152600287016020908152604080832080549686166001600160a01b03199788161790558654909416825260038801905291909120805483168217905582549091161790556200317f565b5060018201546001600160a01b031662002f86565b806001600160a01b031663f1cea4c76040518163ffffffff1660e01b815260040160206040518083038186803b15801562002e2957600080fd5b505afa15801562002e3e573d6000803e3d6000fd5b505050506040513d602081101562002e5557600080fd5b50516040805163f1cea4c760e01b815290516001600160a01b0385169163f1cea4c7916004808301926020929190829003018186803b15801562002e9857600080fd5b505afa15801562002ead573d6000803e3d6000fd5b505050506040513d602081101562002ec457600080fd5b50511162002ed357506200317f565b6001600160a01b038083166000818152600386016020526040808220548585168352912080546001600160a01b0319169184169190911790556001850154909116141562002f3e576001830180546001600160a01b0319166001600160a01b03831617905562002f86565b6001600160a01b03808316600090815260028501602081815260408084205460038901835281852054861685529290915290912080546001600160a01b031916919092161790555b6001600160a01b03811615801590620030735750806001600160a01b031663f1cea4c76040518163ffffffff1660e01b815260040160206040518083038186803b15801562002fd457600080fd5b505afa15801562002fe9573d6000803e3d6000fd5b505050506040513d60208110156200300057600080fd5b50516040805163f1cea4c760e01b815290516001600160a01b0385169163f1cea4c7916004808301926020929190829003018186803b1580156200304357600080fd5b505afa15801562003058573d6000803e3d6000fd5b505050506040513d60208110156200306f57600080fd5b5051115b156200309c576001600160a01b0390811660009081526002840160205260409020541662002f86565b6001600160a01b038116620031125782546001600160a01b038381166000818152600387016020908152604080832080549686166001600160a01b031997881617905588549094168252600288019052828120805485168317905581815291909120805483169055845490911617835562000c2e565b6001600160a01b0390811660008181526003850160209081526040808320805487871680865283862080549289166001600160a01b031993841617905582549097168552600289019093528184208054841687179055805483168617905593825292902080549092161790555b5050565b81546001600160a01b03828116911614801590620031bb57506001600160a01b03818116600090815260028401602052604090205416155b15620031c7576200317f565b60018201546001600160a01b038281169116141562003214576001600160a01b0380821660009081526002840160205260409020546001840180546001600160a01b031916919092161790555b81546001600160a01b038281169116141562003258576001600160a01b03808216600090815260038401602052604090205483546001600160a01b03191691161782555b6001600160a01b038082166000908152600384016020526040902054168015620032b4576001600160a01b038083166000908152600285016020526040808220548484168352912080546001600160a01b031916919092161790555b6001600160a01b03808316600090815260028501602052604090205416801562003310576001600160a01b038084166000908152600386016020526040808220548484168352912080546001600160a01b031916919092161790555b50506001600160a01b03166000908152600282016020908152604080832080546001600160a01b03199081169091556003850190925290912080549091169055600101805460ff60a01b198116600160a01b9182900460ff9081166000190116909102179055565b80471015620033ce576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e6365000000604482015290519081900360640190fd5b6040516000906001600160a01b0384169083908381818185875af1925050503d80600081146200341b576040519150601f19603f3d011682016040523d82523d6000602084013e62003420565b606091505b505090508062000c2e5760405162461bcd60e51b815260040180806020018281038252603a815260200180620066a5603a913960400191505060405180910390fd5b6001600160a01b0380821660008181526003850160205260409020546001850154908316921614806200349c57506001600160a01b038116155b806200357d5750816001600160a01b031663f1cea4c76040518163ffffffff1660e01b815260040160206040518083038186803b158015620034dd57600080fd5b505afa158015620034f2573d6000803e3d6000fd5b505050506040513d60208110156200350957600080fd5b50516040805163f1cea4c760e01b815290516001600160a01b0384169163f1cea4c7916004808301926020929190829003018186803b1580156200354c57600080fd5b505afa15801562003561573d6000803e3d6000fd5b505050506040513d60208110156200357857600080fd5b505111155b156200358a57506200317f565b6001600160a01b038083166000818152600286016020526040808220548585168352912080546001600160a01b03191691841691909117905584549091161415620035ee5782546001600160a01b0319166001600160a01b03821617835562003630565b6001600160a01b0382811660009081526002850160209081526040808320548416835260038701909152902080546001600160a01b0319169183169190911790555b6001600160a01b038116158015906200371d5750816001600160a01b031663f1cea4c76040518163ffffffff1660e01b815260040160206040518083038186803b1580156200367e57600080fd5b505afa15801562003693573d6000803e3d6000fd5b505050506040513d6020811015620036aa57600080fd5b50516040805163f1cea4c760e01b815290516001600160a01b0384169163f1cea4c7916004808301926020929190829003018186803b158015620036ed57600080fd5b505afa15801562003702573d6000803e3d6000fd5b505050506040513d60208110156200371957600080fd5b5051115b1562003746576001600160a01b0390811660009081526003840160205260409020541662003630565b6001600160a01b038116620037be576001830180546001600160a01b038481166000818152600288016020908152604080832080549686166001600160a01b031997881617905560038a0190915280822080548616905585549093168152919091208054831682179055825490911617905562000c2e565b6001600160a01b0390811660008181526002850160208181526040808420805487168552600390980180835281852080546001600160a01b0319908116998916998a17909155848452895489875283872080549190991690821617909755825283208054861685179055929091529052825416179055565b600082620038475750600062003897565b828202828482816200385557fe5b0414620038945760405162461bcd60e51b8152600401808060200182810382526021815260200180620066df6021913960400191505060405180910390fd5b90505b92915050565b60006200389483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525062003980565b60008282018381101562003894576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b60006200389483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525062003a27565b6000818362003a105760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015620039d4578181015183820152602001620039ba565b50505050905090810190601f16801562003a025780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600083858162003a1d57fe5b0495945050505050565b6000818484111562003a7c5760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315620039d4578181015183820152602001620039ba565b505050900390565b612b2f8062003b7683390190565b82805482825590600052602060002090810192821562003aea579160200282015b8281111562003aea57825182546001600160a01b0319166001600160a01b0390911617825560209092019160019091019062003ab3565b5062003af892915062003b3d565b5090565b508054600082559060005260206000209081019062003b1c919062003b5e565b50565b60405180604001604052806002906020820280368337509192915050565b5b8082111562003af85780546001600160a01b031916815560010162003b3e565b5b8082111562003af8576000815560010162003b5f56fe60806040523480156200001157600080fd5b5060405162002b2f38038062002b2f833981810160405260a08110156200003757600080fd5b50805160208201516040830151606084015160809094015160018055929391929091903361f00514620000b1576040805162461bcd60e51b815260206004820152601860248201527f56616c696461746f727320636f6e7472616374206f6e6c790000000000000000604482015290519081900360640190fd5b846001600160a01b03811662000100576040805162461bcd60e51b815260206004820152600f60248201526e496e76616c6964206164647265737360881b604482015290519081900360640190fd5b846001600160a01b0381166200014f576040805162461bcd60e51b815260206004820152600f60248201526e496e76616c6964206164647265737360881b604482015290519081900360640190fd5b838560018260018111156200016057fe5b1415620001b757612710811115620001b1576040805162461bcd60e51b815260206004820152600f60248201526e125b9d985b1a59081c195c98d95b9d608a1b604482015290519081900360640190fd5b62000235565b620001ee600a620001da6003612710620002c660201b620022891790919060201c565b6200032d60201b620022eb1790919060201c565b81111562000235576040805162461bcd60e51b815260206004820152600f60248201526e125b9d985b1a59081c195c98d95b9d608a1b604482015290519081900360640190fd5b6002805462010000600160b01b031916620100006001600160a01b038c81169190910291909117808355600380546001600160a01b031916928c1692909217909155600589905587919060ff1916600183818111156200029157fe5b02179055506002805486919061ff001916610100836003811115620002b257fe5b02179055505050505050505050506200041e565b600082620002d75750600062000327565b82820282848281620002e557fe5b0414620003245760405162461bcd60e51b815260040180806020018281038252602181526020018062002b0e6021913960400191505060405180910390fd5b90505b92915050565b60006200032483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506200037760201b60201c565b60008183620004075760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015620003cb578181015183820152602001620003b1565b50505050905090810190601f168015620003f95780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385816200041457fe5b0495945050505050565b6126e0806200042e6000396000f3fe6080604052600436106102305760003560e01c80638129fc1c1161012e578063ba26d9ff116100ab578063ec0cb3361161006f578063ec0cb33614610285578063f06d5e7714610614578063f1cea4c71461063e578063f3b1cc6714610653578063ff3d9e4f1461066857610230565b8063ba26d9ff14610591578063c19d93fb146105a6578063c967f90f146105cb578063d0e30db0146105f7578063e9fad8ee146105ff57610230565b806397a8ccd5116100f257806397a8ccd5146104d35780639e83d5b1146104db578063a3ec138d146104f0578063a3fbbaae14610549578063a66066791461057c57610230565b80638129fc1c14610453578063826d3dec146104685780638ec7a23d1461047d5780638f76691a146104a95780639001eed8146104be57610230565b806344f99900116101bc578063683c529c11610180578063683c529c146103b457806370ba1113146103ea57806371a1bb75146103ff57806372a11da414610414578063741579b11461043e57610230565b806344f999001461033a578063481c6a751461034f578063483a00e8146103645780634df9d6ba1461036c57806358fd41ea1461039f57610230565b80632b8aba7a116102035780632b8aba7a146102af5780632e4f67e4146102855780633a5381b5146102c45780633ccfd60b146102f557806341f4ca621461030c57610230565b806303fab4f614610235578063158ef93e1461025c57806315de360e1461028557806324c5b1ca1461029a575b600080fd5b34801561024157600080fd5b5061024a610670565b60408051918252519081900360200190f35b34801561026857600080fd5b5061027161067d565b604080519115158252519081900360200190f35b34801561029157600080fd5b5061024a610686565b3480156102a657600080fd5b5061024a61068d565b3480156102bb57600080fd5b5061024a610693565b3480156102d057600080fd5b506102d9610699565b604080516001600160a01b039092168252519081900360200190f35b34801561030157600080fd5b5061030a6106ae565b005b34801561031857600080fd5b5061032161082c565b6040805192835260208301919091528051918290030190f35b34801561034657600080fd5b506102d9610835565b34801561035b57600080fd5b506102d961083b565b61030a61084a565b34801561037857600080fd5b5061024a6004803603602081101561038f57600080fd5b50356001600160a01b0316610b35565b3480156103ab57600080fd5b5061024a610c5a565b3480156103c057600080fd5b506103c9610cfd565b604051808260018111156103d957fe5b815260200191505060405180910390f35b3480156103f657600080fd5b5061024a610d06565b34801561040b57600080fd5b506102d9610d0c565b34801561042057600080fd5b5061030a6004803603602081101561043757600080fd5b5035610d12565b34801561044a57600080fd5b5061024a611031565b34801561045f57600080fd5b5061030a61103d565b34801561047457600080fd5b5061030a611139565b34801561048957600080fd5b5061030a600480360360208110156104a057600080fd5b503515156112cd565b3480156104b557600080fd5b5061024a6114bb565b3480156104ca57600080fd5b5061024a6114c1565b61030a6114cf565b3480156104e757600080fd5b5061030a61165d565b3480156104fc57600080fd5b506105236004803603602081101561051357600080fd5b50356001600160a01b031661185a565b604080519485526020850193909352838301919091526060830152519081900360800190f35b34801561055557600080fd5b5061030a6004803603602081101561056c57600080fd5b50356001600160a01b0316611881565b34801561058857600080fd5b5061030a611929565b34801561059d57600080fd5b5061030a611af2565b3480156105b257600080fd5b506105bb611c2a565b604051808260038111156103d957fe5b3480156105d757600080fd5b506105e0611c38565b6040805161ffff9092168252519081900360200190f35b61030a611c3d565b34801561060b57600080fd5b5061030a611ec5565b34801561062057600080fd5b5061030a6004803603602081101561063757600080fd5b5035612072565b34801561064a57600080fd5b5061024a6121c2565b34801561065f57600080fd5b5061024a6121c8565b61030a6121cf565b68056bc75e2d6310000081565b60005460ff1681565b6201518081565b600d5481565b600c5481565b6002546201000090046001600160a01b031681565b600260015414156106f4576040805162461bcd60e51b815260206004820152601f6024820152600080516020612610833981519152604482015290519081900360640190fd5b600260015533600090815260096020526040902060030154620151809061071c90439061232d565b11610763576040805162461bcd60e51b8152602060048201526012602482015271125b9d195c9d985b081d1bdbc81cdb585b1b60721b604482015290519081900360640190fd5b336000908152600960205260409020600201546107c2576040805162461bcd60e51b815260206004820152601860248201527756616c75652073686f756c64206e6f74206265207a65726f60401b604482015290519081900360640190fd5b33600081815260096020526040812060028101805490839055600390910191909155906107ef908261236f565b60408051828152905133917f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364919081900360200190a25060018055565b60065460075482565b61f00681565b6003546001600160a01b031681565b6003546001600160a01b031633146108a0576040805162461bcd60e51b815260206004820152601460248201527313db9b1e481b585b9859d95c88185b1b1bddd95960621b604482015290519081900360640190fd5b6108a8612459565b6108eb576040805162461bcd60e51b815260206004820152600f60248201526e496e636f727265637420737461746560881b604482015290519081900360640190fd5b600d54158061091057506206270061090e600d544361232d90919063ffffffff16565b115b61095c576040805162461bcd60e51b8152602060048201526018602482015277092dce8cae4ecc2d840dcdee840d8dedcce40cadcdeeaced60431b604482015290519081900360640190fd5b600034116109ac576040805162461bcd60e51b815260206004820152601860248201527756616c75652073686f756c64206e6f74206265207a65726f60401b604482015290519081900360640190fd5b6000600d556004546109be90346124b9565b60045560408051348152905133917f278e696bd0cd4a7d1260ced26c40cd01c2b088f441889e4148240ac81069b348919081900360200190a26000600160025460ff166001811115610a0c57fe5b1415610a215750670de0b6b3a7640000610a2e565b5069010f0cf064dd592000005b8060045410610b32576002805461ff0019166101001790819055604080516363e1d45160e01b8152620100009092046001600160a01b031660048301525161f006916363e1d45191602480830192600092919082900301818387803b158015610a9657600080fd5b505af1158015610aaa573d6000803e3d6000fd5b5050505061f0056001600160a01b031663136ec0b36040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610aeb57600080fd5b505af1158015610aff573d6000803e3d6000fd5b5050600254610100900460ff169150506003811115610b1a57fe5b60405160008051602061266a83398151915290600090a25b50565b60408051637a0787a960e11b81523060048201529051600091829161f0059163f40f0f52916024808301926020929190829003018186803b158015610b7957600080fd5b505afa158015610b8d573d6000803e3d6000fd5b505050506040513d6020811015610ba357600080fd5b5051600554909150600090610bc79061271090610bc1908590612289565b906122eb565b600a54600b549192509015610c0e57610c0b81610c05600b54610bc1670de0b6b3a7640000610bff888a61232d90919063ffffffff16565b90612289565b906124b9565b90505b6001600160a01b038516600090815260096020526040902060018101549054610c519190610c4b90670de0b6b3a764000090610bc1908690612289565b9061232d565b95945050505050565b60408051637a0787a960e11b81523060048201529051600091829161f0059163f40f0f52916024808301926020929190829003018186803b158015610c9e57600080fd5b505afa158015610cb2573d6000803e3d6000fd5b505050506040513d6020811015610cc857600080fd5b5051600554909150600090610ce69061271090610bc1908590612289565b600854909150610cf690826124b9565b9250505090565b60025460ff1681565b60055481565b61f00581565b60026001541415610d58576040805162461bcd60e51b815260206004820152601f6024820152600080516020612610833981519152604482015290519081900360640190fd5b600260015580610daa576040805162461bcd60e51b815260206004820152601860248201527756616c75652073686f756c64206e6f74206265207a65726f60401b604482015290519081900360640190fd5b33600090815260096020526040902054811115610e04576040805162461bcd60e51b8152602060048201526013602482015272125b9cdd59999a58da595b9d08185b5bdd5b9d606a1b604482015290519081900360640190fd5b61f0056001600160a01b031663c885bc586040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610e4157600080fd5b505af1158015610e55573d6000803e3d6000fd5b505033600090815260096020526040812060018101549054600a54929450610e9193509091610c4b91670de0b6b3a764000091610bc191612289565b600b54909150610ea1908361232d565b600b5533600090815260096020526040902054610ebe908361232d565b336000908152600960205260409020819055600a54610eeb91670de0b6b3a764000091610bc19190612289565b336000908152600960205260409020600190810191909155600254610100900460ff166003811115610f1957fe5b1415610f755761f0056001600160a01b031663bb8b65af6040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610f5c57600080fd5b505af1158015610f70573d6000803e3d6000fd5b505050505b33600090815260096020526040902060020154610f9290836124b9565b336000818152600960205260409020600281019290925543600390920191909155610fbd908261236f565b60408051838152905133917f41b45db803eded5e27cdf3cbba5707b3575e9b6959de41c3f7b83b51ce600502919081900360200190a260408051828152905133917f7cddc560d4de1ea9d83e4123f01e6072afc503bb47bcc765f0396ba3861a0454919081900360200190a2505060018055565b670de0b6b3a764000081565b3361f0051461108e576040805162461bcd60e51b815260206004820152601860248201527756616c696461746f727320636f6e7472616374206f6e6c7960401b604482015290519081900360640190fd5b60005460ff16156110dc576040805162461bcd60e51b8152602060048201526013602482015272105b1c9958591e481a5b9a5d1a585b1a5e9959606a1b604482015290519081900360640190fd5b6000805460ff191660011781556040805163136ec0b360e01b8152905161f0059263136ec0b3926004808201939182900301818387803b15801561111f57600080fd5b505af1158015611133573d6000803e3d6000fd5b50505050565b3361f00614611186576040805162461bcd60e51b815260206004820152601460248201527350756e69736820636f6e7472616374206f6e6c7960601b604482015290519081900360640190fd5b43600c5560028054610100900460ff1660038111156111a157fe5b146111e2576002805461ff0019166103001790819055610100900460ff1660038111156111ca57fe5b60405160008051602061266a83398151915290600090a25b61f0056001600160a01b03166371df76786040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561121f57600080fd5b505af1158015611233573d6000803e3d6000fd5b50505050600068056bc75e2d6310000060045410156112545760045461125f565b68056bc75e2d631000005b90508015610b3257600454611274908261232d565b60045561128260008261236f565b600254604080518381529051620100009092046001600160a01b0316917febbcaaf6b9aa8b4083ae4b2f842c8de6f75319018e7b5e141a1e87aebadde6c3916020908290030190a250565b3361f0051461131e576040805162461bcd60e51b815260206004820152601860248201527756616c696461746f727320636f6e7472616374206f6e6c7960401b604482015290519081900360640190fd5b80156114245761132c612459565b8061134c57506001600254610100900460ff16600381111561134a57fe5b145b61138f576040805162461bcd60e51b815260206004820152600f60248201526e496e636f727265637420737461746560881b604482015290519081900360640190fd5b6002805461ff0019166102001790819055610100900460ff1660038111156113b357fe5b60405160008051602061266a83398151915290600090a261f0056001600160a01b03166371df76786040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561140757600080fd5b505af115801561141b573d6000803e3d6000fd5b50505050610b32565b60028054610100900460ff16600381111561143b57fe5b1461147f576040805162461bcd60e51b815260206004820152600f60248201526e496e636f727265637420737461746560881b604482015290519081900360640190fd5b6002805461ff00191690819055610100900460ff16600381111561149f57fe5b60405160008051602061266a83398151915290600090a2610b32565b60045481565b69010f0cf064dd5920000081565b60026001541415611515576040805162461bcd60e51b815260206004820152601f6024820152600080516020612610833981519152604482015290519081900360640190fd5b60026001556003546001600160a01b03163314611570576040805162461bcd60e51b815260206004820152601460248201527313db9b1e481b585b9859d95c88185b1b1bddd95960621b604482015290519081900360640190fd5b61f0056001600160a01b031663c885bc586040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156115ad57600080fd5b505af11580156115c1573d6000803e3d6000fd5b5050505060006008541161160d576040805162461bcd60e51b815260206004820152600e60248201526d139bc81b5bdc99481c995dd85c9960921b604482015290519081900360640190fd5b600880546000909155611620338261236f565b60408051828152905133917fe4fc75e2b70d2f179fc77c722f2334ba1507c59932576ec9620b15dfb06d91e2919081900360200190a25060018055565b600260015414156116a3576040805162461bcd60e51b815260206004820152601f6024820152600080516020612610833981519152604482015290519081900360640190fd5b60026001556003546001600160a01b031633146116fe576040805162461bcd60e51b815260206004820152601460248201527313db9b1e481b585b9859d95c88185b1b1bddd95960621b604482015290519081900360640190fd5b611706612459565b611749576040805162461bcd60e51b815260206004820152600f60248201526e496e636f727265637420737461746560881b604482015290519081900360640190fd5b6000600d5411801561177157506206270061176f600d544361232d90919063ffffffff16565b115b6117bd576040805162461bcd60e51b8152602060048201526018602482015277092dce8cae4ecc2d840dcdee840d8dedcce40cadcdeeaced60431b604482015290519081900360640190fd5b600060045411611805576040805162461bcd60e51b815260206004820152600e60248201526d27379036b7b9329036b0b933b4b760911b604482015290519081900360640190fd5b6000600d8190556004805491905561181d338261236f565b60408051828152905133917f5d3b8fa9823b18b176cfe79e002a5b931b8569313802f700eb8550bc6a353246919081900360200190a25060018055565b60096020526000908152604090208054600182015460028301546003909301549192909184565b6002546201000090046001600160a01b031633146118df576040805162461bcd60e51b815260206004820152601660248201527513db9b1e481d985b1a59185d1bdc88185b1b1bddd95960521b604482015290519081900360640190fd5b600380546001600160a01b0319166001600160a01b0383169081179091556040517f5cd5185727f6057b7a274979ce4d902e15bf0ef1dc542d1fe5926cba874f63b690600090a250565b6003546001600160a01b0316331461197f576040805162461bcd60e51b815260206004820152601460248201527313db9b1e481b585b9859d95c88185b1b1bddd95960621b604482015290519081900360640190fd5b60025460065460ff90911690600182600181111561199957fe5b14156119ed576127108111156119e8576040805162461bcd60e51b815260206004820152600f60248201526e125b9d985b1a59081c195c98d95b9d608a1b604482015290519081900360640190fd5b611a45565b6119ff600a610bc16127106003612289565b811115611a45576040805162461bcd60e51b815260206004820152600f60248201526e125b9d985b1a59081c195c98d95b9d608a1b604482015290519081900360640190fd5b60075415801590611a6657506007546201518090611a6490439061232d565b115b611ab2576040805162461bcd60e51b8152602060048201526018602482015277092dce8cae4ecc2d840dcdee840d8dedcce40cadcdeeaced60431b604482015290519081900360640190fd5b600680546005819055600091829055600782905560405190917f450a792501c47863e89114cbdd0497acb22d4abfc51dc315afc323c5ba92d4a991a25050565b3361f00614611b3f576040805162461bcd60e51b815260206004820152601460248201527350756e69736820636f6e7472616374206f6e6c7960601b604482015290519081900360640190fd5b61f0056001600160a01b031663c885bc586040518163ffffffff1660e01b8152600401600060405180830381600087803b158015611b7c57600080fd5b505af1158015611b90573d6000803e3d6000fd5b50505050600068056bc75e2d6310000060085410611bb75768056bc75e2d63100000611bbb565b6008545b600854909150611bcb908261232d565b6008558015610b3257611bdf60008261236f565b600254604080518381529051620100009092046001600160a01b0316917f0a3c8b346f3f7fe5668c9f575473491c4274339e10c9548d7995f22211f988f0916020908290030190a250565b600254610100900460ff1681565b601581565b60026001541415611c83576040805162461bcd60e51b815260206004820152601f6024820152600080516020612610833981519152604482015290519081900360640190fd5b600260018190555061f0056001600160a01b031663c885bc586040518163ffffffff1660e01b8152600401600060405180830381600087803b158015611cc857600080fd5b505af1158015611cdc573d6000803e3d6000fd5b505033600090815260096020526040812060018101549054600a54929450611d1893509091610c4b91670de0b6b3a764000091610bc191612289565b90503415611e395733600090815260096020526040902054611d3a90346124b9565b336000908152600960205260409020819055600a54611d6791670de0b6b3a764000091610bc19190612289565b33600090815260096020526040902060010155600b54611d8790346124b9565b600b5560408051348152905133917fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c919081900360200190a26001600254610100900460ff166003811115611dd857fe5b1415611e345761f0056001600160a01b031663136ec0b36040518163ffffffff1660e01b8152600401600060405180830381600087803b158015611e1b57600080fd5b505af1158015611e2f573d6000803e3d6000fd5b505050505b611e77565b600a5433600090815260096020526040902054611e6391670de0b6b3a764000091610bc191612289565b336000908152600960205260409020600101555b8015611ebe57611e87338261236f565b60408051828152905133917f7cddc560d4de1ea9d83e4123f01e6072afc503bb47bcc765f0396ba3861a0454919081900360200190a25b5060018055565b6003546001600160a01b03163314611f1b576040805162461bcd60e51b815260206004820152601460248201527313db9b1e481b585b9859d95c88185b1b1bddd95960621b604482015290519081900360640190fd5b6001600254610100900460ff166003811115611f3357fe5b1480611f425750611f42612459565b611f85576040805162461bcd60e51b815260206004820152600f60248201526e496e636f727265637420737461746560881b604482015290519081900360640190fd5b43600d556000600254610100900460ff166003811115611fa157fe5b14612033576002805461ff00191690819055610100900460ff166003811115611fc657fe5b60405160008051602061266a83398151915290600090a261f0056001600160a01b03166371df76786040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561201a57600080fd5b505af115801561202e573d6000803e3d6000fd5b505050505b600254604051620100009091046001600160a01b0316907f7c79e6e24ed041d1072d54523b53956f01b91b835f0490856370594d9d14470e90600090a2565b6003546001600160a01b031633146120c8576040805162461bcd60e51b815260206004820152601460248201527313db9b1e481b585b9859d95c88185b1b1bddd95960621b604482015290519081900360640190fd5b60025460ff168160018260018111156120dd57fe5b14156121315761271081111561212c576040805162461bcd60e51b815260206004820152600f60248201526e125b9d985b1a59081c195c98d95b9d608a1b604482015290519081900360640190fd5b612189565b612143600a610bc16127106003612289565b811115612189576040805162461bcd60e51b815260206004820152600f60248201526e125b9d985b1a59081c195c98d95b9d608a1b604482015290519081900360640190fd5b60068390554360075560405183907f2dcbffddb492dea86de0b18dac6d71f51a7b7a5ec946512e0c993a050f3b48ea90600090a2505050565b600b5481565b6206270081565b3361f00514612220576040805162461bcd60e51b815260206004820152601860248201527756616c696461746f727320636f6e7472616374206f6e6c7960401b604482015290519081900360640190fd5b600061223d612710610bc16005543461228990919063ffffffff16565b60085490915061224d90826124b9565b600855600b5415610b3257612283600a54610c05600b54610bc1670de0b6b3a7640000610bff873461232d90919063ffffffff16565b600a5550565b600082612298575060006122e5565b828202828482816122a557fe5b04146122e25760405162461bcd60e51b815260040180806020018281038252602181526020018061268a6021913960400191505060405180910390fd5b90505b92915050565b60006122e283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612513565b60006122e283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506125b5565b804710156123c4576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e6365000000604482015290519081900360640190fd5b6040516000906001600160a01b0384169083908381818185875af1925050503d806000811461240f576040519150601f19603f3d011682016040523d82523d6000602084013e612414565b606091505b50509050806124545760405162461bcd60e51b815260040180806020018281038252603a815260200180612630603a913960400191505060405180910390fd5b505050565b600080600254610100900460ff16600381111561247257fe5b14806124b457506003600254610100900460ff16600381111561249157fe5b1480156124b45750620151806124b2600c544361232d90919063ffffffff16565b115b905090565b6000828201838110156122e2576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000818361259f5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561256457818101518382015260200161254c565b50505050905090810190601f1680156125915780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385816125ab57fe5b0495945050505050565b600081848411156126075760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561256457818101518382015260200161254c565b50505090039056fe5265656e7472616e637947756172643a207265656e7472616e742063616c6c00416464726573733a20756e61626c6520746f2073656e642076616c75652c20726563697069656e74206d61792068617665207265766572746564402ee26d4c255fcb07b0b7b5b93b77377832260977c25be44f3c8feffd2df70e536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a2646970667358221220f05f5d28fbe34b769752c00eaa5f819e386b605330eec67ffed226f1db9d53c864736f6c634300060c0033536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77416464726573733a20756e61626c6520746f2073656e642076616c75652c20726563697069656e74206d61792068617665207265766572746564536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77436f72726573706f6e64696e6720766f746520706f6f6c206e6f7420666f756e64a264697066735822122047813dd1feeee5afc91803ec03ce8fe665f7069a91b4fa63f00ff5bc869f824964736f6c634300060c0033"
)

type hardForkValidatorsV2 struct {
}

func (s *hardForkValidatorsV2) GetName() string {
	return ValidatorsV1ContractName
}

func (s *hardForkValidatorsV2) Update(config *params.ChainConfig, height *big.Int, state *state.StateDB) (err error) {
	contractCode := common.FromHex(validatorsV2Code)

	//write validatorsV2Code to sys contract
	state.SetCode(ValidatorsV1ContractAddr, contractCode)
	log.Debug("Upgrade code to system contract account", "addr", ValidatorsV1ContractAddr.String(), "code", validatorsV2Code)

	return
}

func (s *hardForkValidatorsV2) Execute(state *state.StateDB, header *types.Header, chainContext core.ChainContext, config *params.ChainConfig) (err error) {

	return
}
